
public class Homework4 {

	public static void main(String[] args) {
		int[] oldArr = { 1, 3, 4, 5, 0, 0, 6, 6, 0, 5, 4, 7, 6, 7, 0, 5 };

		for (int i = 0; i < oldArr.length; i++) {
			int a = 0;
			if (oldArr[i] == 0) {
				a++;
			} else {
				int newArr[] = new int[oldArr.length - a];
				for (int j = 0; j < oldArr.length; j++) {
					newArr[j] = oldArr[i];
				}
				System.out.print(newArr[i] + ",");
			}
		}

	}

}
